package com.hdax.dm.rabbitMQ;

import com.hdax.dm.entity.order.OrderLinkUser;
import com.hdax.dm.feign.order.OrderLinkUserFeign;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RabbitListener(queues = "dm_order_link_user_rollback")
public class OrderLinkUserRollBack {

    @Autowired
    private OrderLinkUserFeign orderLinkUserFeign;

    @RabbitHandler
    public void orderLinkUserRollBack(Long orderId){
        orderLinkUserFeign.deleteOrderLinkUser(orderId);
        System.out.println("订单联系人回滚了--------------------------");
    }

}
